﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessLogic;
using System.Data;

namespace ATM_System_Mock1_G2
{
    public partial class CheckBalance : System.Web.UI.Page
    {
        CardEntites card = new CardEntites();
       
        LogEntites logE = new LogEntites();
        LogBL logB = new LogBL();
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                AccountBL account = new AccountBL();
                DataTable dt = new DataTable();
                dt = account.Diplay(card);
                Rptcheckbalance.DataSource = dt;
                Rptcheckbalance.DataBind();
            }

        }

        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("Home.aspx");
        }

        protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
        {
            logE.LogTypeID = 6;
            logE.ATMID = 2;
            logE.CardNo = Session["CardNo"].ToString();
            logE.LogDate = DateTime.Now;
            logE.Amount = 0;
            logE.Details = "CheckBalace";
            logB.writeLog(logE);
            Response.Redirect("CheckBalance2.aspx");
            
        }

        protected void Button11_Click(object sender, EventArgs e)
        {
           // Response.Redirect("Home.aspx");
            Response.Redirect("CheckBalance2.aspx");
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            Response.Redirect("Home.aspx");
        }
    }
}